<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>轮播图</title>
</head>
<body>
<img src="../../image/a.png" height="300px" id="i1">
</body>

<script>
    /*
        分析：
            1.在页面上使用img标签展示图片
            2.定义一个方法，修改图片对象的src属性
            3.定义一个定时器，每隔几秒调用方法
    */
    //修改图片src
    var num = 0;
    var nums = ["a","b","c"];
    function fun(){
        num++;
        var i = num % 3;
        var imgs = document.getElementById("i1");
        var str = "../../image/"+nums[i] +".png";
        imgs.src = str;
    }

    setInterval(fun,3000);
</script>

</html>